// @ts-ignore
/* eslint-disable */
import { request } from '@/utils/request'

/** addCart POST /api/cart/add */
export async function addCartUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.addCartUsingPOSTParams,
  options?: { [key: string]: any }
) {
  return request<API.ResultLong_>('/api/cart/add', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** delCart DELETE /api/cart/delete/${param0} */
export async function delCartUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.delCartUsingDELETEParams,
  options?: { [key: string]: any }
) {
  const { cartId: param0, ...queryParams } = params
  return request<API.ResultBoolean_>(`/api/cart/delete/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** listCartInfosByPage POST /api/cart/page */
export async function listCartInfosByPageUsingPost(
  body: API.PageDto,
  options?: { [key: string]: any }
) {
  return request<API.ResultPageBeanCartVo_>('/api/cart/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** purchaseProductByCart POST /api/cart/purchase */
export async function purchaseProductByCartUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.purchaseProductByCartUsingPOSTParams,
  options?: { [key: string]: any }
) {
  return request<API.ResultBoolean_>('/api/cart/purchase', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}
